Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

get-blob-duration

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

get-blob-duration

Convenience method to patch Chromium bug when getting duration of HTML5 video or audio Blob.

  • 1.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
21K
increased by15.89%
Maintainers
1
Weekly downloads
 
Created
Source

get-blob-duration

Convenience method to patch Chromium bug when getting duration of HTML5 video or audio Blob.

Installation

npm install --save get-blob-duration

or

yarn add get-blob-duration

Usage

Import the method however you like (browser, module, etc.). Once you have it in scope:

// Returns Promise<Number>
getBlobDuration(blob).then(function(duration) {
  console.log(duration + ' seconds');
});

Or use ECMAScript 6:

import getBlobDuration from 'get-blob-duration'

(async function() {
  const duration = await getBlobDuration(blob)
  console.log(duration + ' seconds')
})()

Or pass an object URL string if you already have one:

import getBlobDuration from 'get-blob-duration'

(async function() {
  const blobUrl = 'blob:https://mdn.mozillademos.org/012345678-9abc-def0-1234-56789abcdef0'
  const duration = await getBlobDuration(blobUrl)
  console.log(duration + ' seconds')
})()

Changelog

1.2.0

  • Security: Update deps
  • Bug: Fix #8 (thx @fheyen for bug report)
  • Task: Pin deps
  • Improvement: Introduce Github Actions
  • Improvement: Promise rejects if video el throws an error (thx @Stopa for code)

1.1.2

  • Bump lodash from 4.17.15 to 4.17.19 pull #6
  • Audit fix + npm up

1.1.1

  • Update deps

1.1.0

  • Allow usage with blob URL - kandros
  • Typescript typings - kandros
  • Fix npm audits + various package upgrades

1.0.1

  • Typescript defs (thanks kandros)
  • Fix audits + gulp update to ^4.0.0

1.0.0

Initial release

Keywords

FAQs

Package last updated on 03 Apr 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc